assume cs:codesg
datasg segment
    ;total:21
           db 21 dup('19??')    ; byte   year    1b total: 84bytes; range: 0-53H
           dd 21 dup(8000)      ; dword  sum     4b total: 84bytes; range: 54H-0A7H
           dw 21 dup(1442)      ; word  person   2b total: 42bytes; range: 0A8H-0D1H
datasg ends
table segment
          db 21 dup('year summ ne ?? '); byte table 1b total: 16×21=336;
          ;range:0D2H-221H ; fact:00E0H-022FH
table ends
codesg segment
    start: mov ax, datasg
           mov ds, ax

           mov ax, table
           mov es, ax

           mov cx, 21
           mov bx, 0
           ;s代表每条记录
        s: push bx
        ; 开始录入年份
            mov ax, ds:[bx]
            mov es:[bx], ax
            add bx,2
            mov ax, ds:[bx]
            mov es:[bx], ax

; 开始录入总收入，高位到DX，低位到AX
        
            mov  dx, 54[bx]
            mov ax, 54[bx+2]
            mov cx, 0A8[bx]
            div word ptr cx;

            mov ax, 13[bx]
        

        
        ; 开始录入人数到BX
        s2:

            pop bx
            add bx, 16
            loop s; 结束循环


codesg ends
end start